import request from '@/utils/request'

export function getDetail(id) {
  return request({
    url: 'api/prescription/detail?id=' + id,
    method: 'get'
  })
}

// 订单 收费
export function goPayApi(data) {
  const url = '/api/recipel/chargeOrder'
  return request({
    url: url,
    method: 'post',
    data
  })
}
// 订单 审方
export function orderCheckOrder(data) {
  const url = '/api/recipel/checkOrder'
  return request({
    url: url,
    method: 'post',
    data
  })
}
// 订单 调剂
export function orderConfirmOrder(data) {
  const url = '/api/recipel/confirmOrder'
  return request({
    url: url,
    method: 'post',
    data
  })
}

export function confirmOrder(id) {
  return request({
    url: 'api/prescription/confirmOrder?id=' + id,
    method: 'post'
  })
}

export function updateOrder(id) {
  return request({
    url: 'api/prescription/updateOrder?id=' + id,
    method: 'post'
  })
}

export function updateOrderr(id) {
  const data = id
  return request({
    url: 'api/recipel/updateOrder',
    method: 'post',
    data
  })
}

export function refund(data, id, msg) {
  return request({
    url: 'api/prescription/refund?orderNO=' + id + '&refundMsg=' + msg,
    method: 'post',
    data
  })
}

export function printOrder(id) {
  return request({
    url: 'api/prescription/printOrder?id=' + id,
    method: 'get'
  })
}

export function checkOrder(data) {
  return request({
    url: 'api/prescription/checkOrder',
    method: 'post',
    data
  })
}

export function recipelUpdateOrder(orderNo) {
  return request({
    url: 'api/recipel/updateOrder',
    method: 'post',
    data: {
      orderNo
    }
  })
}

export function addOrderList(data) {
  return request({
    url: 'api/logistics/addOrderList',
    method: 'post',
    data: data
  })
}

// 云享订单退款处理
export function comfireStock(data) {
  const url = '/api/recipel/comfireStock'
  return request({
    url: url,
    method: 'post',
    data
  })
}

// 订单补发
export function reissue(data) {
  const url = '/api/recipel/reissue'
  return request({
    url: url,
    method: 'post',
    data
  })
}

